home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSTIPS5.ZIP / DOSMISC < prev    next >
Text File  |  1986-12-17  |  49KB  |  1,092 lines

  1.                           Switch Hitter
  2.         (PC Magazine Vol 5 No 13 July 1986 User-to-User)
  3.  
  4.      Some people prefer the UNIX standard of "/" for a directory
  5. separator and a "-" for a command switch.  Making the change is simple
  6. using the undocumented DOS Function Call 37.  All you have to do is
  7. change the switch character from "/" to "-".  To create SWITCHAR.COM,
  8. extract and name the file below SWITCHAR.SCR.  Use DEBUG and issue the
  9. command:  DEBUG < SWITCHAR.SCR
  10.      To use SWITCHAR.COM, type SWITCHAR X where X is the new switch
  11. character.  Or just type SWITCHAR to reset the switch to the normal /.
  12. For instance, if you type  SWITCHAR -  you can then get a paused
  13. directory listing by typing  DIR -P  instead of DIR/P.
  14.      Editor's Note:  Using nondocumented calls can create problems.
  15. IBM removed its own SWITCHAR config function from DOS; if you feel the
  16. need to reconfigure your switch character, you'll be experimenting at
  17. your own risk.
  18.  
  19. SWITCHAR.SCR:
  20.  
  21. N SWITCHAR.COM
  22. A
  23. JMP 0120
  24. DB 'Switch character is now "/"',0D,0A,'$'
  25. MOV DL,[0080]
  26. CMP DL,00               ; did get command argument?
  27. JZ 012F
  28. MOV DL,[0082]           ; yes, use it as switchar
  29. JMP 0130
  30. MOV DL,2F               ; no, use / (2F) as switchar
  31. MOV AX,3701             ; AL=1 for setchar from DL
  32. INT 21                  ; set the switchar
  33. MOV DI,0102
  34. MOV [DI+19],DL          ; modify the message
  35. MOV DX,DI
  36. MOV AH,09
  37. INT 21                  ; tell user what we did
  38. INT 20                  ; and exit
  39.  
  40. RCX
  41. 45
  42. W
  43. Q
  44.  
  45. -----------------------------------------------------------------
  46.                    COPYing File to Themselves
  47.           (PC Magazine Vol 5 No 13 July 1986 PC Tutor)
  48.  
  49.      A user invoked the command:  ASSIGN A=C.  Later he tried to copy
  50. a hard disk file to a floppy using the command:  COPY C:filename A:
  51. COPY went ahead and tried to copy the file on top of itself.  This
  52. wouldn't have been so bad, except that the file was originally about
  53. 120K, and after the message "File allocation table error" was
  54. displayed, the file ended up 64K long.
  55.      ASSIGN and COPY collided in this case.  The ASSIGN command is bad
  56. news.  ASSIGN is a memory-resident program that intercepts most DOS
  57. file calls and simply swaps disk drive letters.  It was included with
  58. DOS 2.0 and later to deal with those dumb pre-XT programs that assumed
  59. every PC has only drives A: and B: and nothing more.  All of the DOS
  60. commands include warnings about using ASSIGN.
  61.      If you must use ASSIGN with certain programs, then don't issue
  62. the ASSIGN commands indiscriminately.  Put them in a batch file:
  63.  
  64. ASSIGN A=C B=C
  65. {program that can't use drive C:}
  66. ASSIGN
  67.  
  68. The last ASSIGN undoes all the ASSIGNments so you won't accidentally
  69. do something like your fatal attempt to use the COPY command.
  70.      COPY will usually detect when you are trying to copy a file to
  71. itself.  For instance, if you have a file called MYFILE and you use:
  72.  
  73. COPY MYFILE MYFILE
  74.  
  75. it will tell you it can't do it.  But COPY can be fooled.  If MYFILE
  76. is located in the root directory and you enter:
  77.  
  78. COPY MYFILE \MYFILE
  79.  
  80. COPY doesn't realize these are the same file.  Obviously, COPY is only
  81. doint a simple string compare to determine if you're trying to copy a
  82. file to itself.  This will always be a problem whenever your file is
  83. larger than 64K.
  84.      Here's what happens in that case.  COPY will open the first file
  85. for reading.  It will read 64K of the file into memory (less if 64K is
  86. not available).  It then tells DOS to create a second file.  If the
  87. second file already exists (as it does in this case), the file gets
  88. truncated to 0 bytes and the space in the file allocation table is
  89. freed up.  Then COPY writes the 64K buffer to the second file.  At
  90. this point, COPY goes back to read the next chunk of the first file.
  91. However, when DOS now takes a look at the file allocation table for
  92. the first file, it finds that all the clusters have been unassigned.
  93.  
  94. -----------------------------------------------------------------
  95.                          At Your Command
  96.                (PC World July 1986 Star-Dot-Star)
  97.  
  98.      More and more programs can execute DOS commands while running,
  99. but most are limited to just one command at a time.  WordStar 3.3,
  100. dBASE III Plus, KnowledgeMan/2, and Microsoft Word are a few.  This
  101. single-command limitation can be a nuisance.  For example, if the
  102. DOS command you want to execute is not in the current subdirectory,
  103. or if you wish to perform several commands in sequence, completing
  104. your task can take several steps.
  105.      If COMMAND.COM is executed, DOS will load a copy of itself into
  106. memory, and you can then execute as many other commands as you like.
  107. When you have finished, simply enter the EXIT command at the DOS
  108. prompt, and the application program is returned.
  109.      Before issuing the EXIT command, be careful to return to the
  110. subdirectory and logged disk drive that were originally in effect.
  111. If you don't, the application program might not be able to find its
  112. overlay files or other information that it needs to continue.  Even
  113. so, this may not work for all programs, all versions of DOS, or on
  114. some "compatible" machines.
  115.  
  116. -----------------------------------------------------------------
  117.                          Custom 3.2 DOS
  118.              (PC Magazine August 1986 User-to-User)
  119.  
  120.      A prior article (PC Mag Vol 4 No 24 User-to-User) showed how to
  121. default COMMAND.COM to ECHO OFF (rather than the annoying ECHO ON,
  122. which forces users to brute-force it off in every batch file) and
  123. allowed an ECHO with two spaces after it to generate a blank line.
  124. It also explained why COMMAND.COM's CLS command cleared an extra line
  125. and showed how to fix this.
  126.      DOS 3.2 has to be patched differently.  For the ECHO+space+space
  127. fix, type the following:
  128.  
  129. A>DEBUG COMMAND.COM
  130. -E 3A88 83
  131. -E 3A89 F9
  132. -E 3A8A 02
  133. -E 3A8B 72
  134. -W
  135. -Q
  136.  
  137. For ECHO OFF defaults for batch files, type:
  138.  
  139. A>DEBUG COMMAND.COM
  140. -E 115E 02
  141. -E 1B2C 00
  142. -W
  143. -Q
  144.  
  145. The CLS patch is not required in DOS 3.2.
  146.  
  147. -----------------------------------------------------------------
  148.                   Sorting the Directory by Date
  149.                (PC Magazine August 1986 PC Tutor)
  150.  
  151.      The most useful way to display a directory is chronologically by
  152. date, with the most recently created or modified files at the bottom.
  153. The SORT filter can be used with a month-day-year format.  The normal
  154. DIR listing is displayed in month-day-year format.  Including the time
  155. field would be useful, too, but that's complicated by the use of an
  156. A.M. and P.M. identifier instead of a 24-hour clock.
  157.      DOS 3.0 or 3.1 (and presumably 3.2) can do this.  These versions
  158. contain internal tables that embody foreign-country information,
  159. including date formats, time formats, currency symbols, decimal
  160. separators, etc.  This information is available for programs to use
  161. through DOS calls.  Although most programs don't take advantage of this
  162. facility (it's not available in DOS 2.x), the programs and commands
  163. included with DOS 3.x -- such as DIR -- alter their date and time
  164. displays to those of the country currently set.
  165.      You can make DOS believe it's in a different country simply by
  166. including a line in your CONFIG.SYS file.  Of the support countries,
  167. only Sweden uses the year-month-day format.  So your CONFIG.SYS file
  168. could have the line:
  169.  
  170. COUNTRY=046
  171.  
  172. The 046 is the code for Sweden.  The numbers DOS uses are the
  173. international telephone system country codes.
  174.      Reboot with the CONFIG.SYS file in the root directory of your
  175. boot drive and do a DIR; it will look a little different, but the date
  176. and time will be exacltly the way you need to have them run a sort by
  177. year, then by months and days.  Now you can set up a batch file with
  178. the line:
  179.  
  180. DIR | SORT /+24
  181.  
  182. and you'll get a true date sort.
  183.      One problem with this procedure is that you may someday encounter
  184. an applications program that insists on using the Swedish kroner symbol
  185. instead of a dollar sign since DOS continues to use country information
  186. you set with CONFIG.SYS and so believes it's in Sweden. If you'd rather
  187. not spend all your DOS days in Sweden, you can remove the COUNTRY line
  188. from your CONFIG.SYS file and use a couple of short programs to change
  189. the country as you wish.  These programs will let you fly to Sweden and
  190. back again real quick.  Use DEBUG to create the SWEDEN.COM file:
  191.  
  192. DEBUG
  193. -N SWEDEN.COM
  194. -A
  195. 2C7A:0100 MOV DX,FFFF
  196. 2C7A:0103 MOV AL,2E
  197. 2C7A:0105 MOV AH,38
  198. 2C7A:0107 INT 21
  199. 2C7A:0109 INT 20
  200. 2C7A:010B
  201. -R CX
  202. CX 0000
  203. :B
  204. -W
  205. Writing 000B bytes
  206. -Q
  207.  
  208. Also use DEBUG to create USA.COM:
  209.  
  210. DEBUG
  211. -N USA.COM
  212. -A
  213. 2C7A:0100 MOV DX,FFFF
  214. 2C7A:0103 MOV AL,01
  215. 2C7A:0105 MOV AH,38
  216. 2C7A:0107 INT 21
  217. 2C7A:0109 INT 20
  218. 2C7A:010B
  219. -R CX
  220. CX 0000
  221. :B
  222. -W
  223. Writing 000B bytes
  224. -Q
  225.  
  226. Your batch file would not look like:
  227.  
  228. SWEDEN
  229. DIR | SORT /+24
  230. USA
  231.  
  232. The value of the AL register in these programs is the same as the
  233. country code used in the CONFIG.SYS COUNTRY statement but expressed in
  234. hexadecimal rather than decimal numbers.
  235.  
  236. -----------------------------------------------------------------
  237.                Merging Two Files into One with DOS
  238.                 (Personal Computing August 1986)
  239.  
  240.      There is a section of the DOS COPY command that lets you join any
  241. number of files into one file.  At the A> or C> prompt, you simply type
  242. COPY and the names of the files you want to join, with a plus sign
  243. between each file name.  Files from different drives can be joined by
  244. specifying the drive before the file name.  Here is an example of the
  245. command used for combining three files:
  246.  
  247. COPY MEMOSMAY + MEMOSJUN + B:MEMOSJUL MEMOS.
  248.  
  249. In this example, the three memo files for May, June and July (in
  250. drive B:) are combined into a new file, called MEMOS.  If you don't
  251. include a name for the new combined file, and separate it from the
  252. end of the other file names by a space, this command will combine the
  253. files in the first file named.
  254.      If you have a long string of files you want to combine and they
  255. all have the same extension or previx to their names, you can use the
  256. * symbol to indicate them.  So, if we had three files with the prefix
  257. memos, we could have typed:
  258.  
  259. COPY MEMOS* MEMOS
  260.  
  261. You have to be careful that this broad combine command doesn't pull in
  262. files you don't want, but nonetheless start off with the letters
  263. "memos."  In like fashion, you can use the ? symbol in the command to
  264. stand for any character.  For example, if you have a group of files
  265. that all end in a year number, such as MEMOS83, MEMOS84, and MEMOS85,
  266. you could combine them into a new file by typing:
  267.  
  268. COPY MEMOS8? MEMOS86
  269.  
  270. -----------------------------------------------------------------
  271.                     Alternate Configurations
  272.               (PC World August 1986 Star-Dot-Star)
  273.  
  274.      If you happen to have any programs that don't run if ANSI.SYS is
  275. present (there are some), you can use a batch file that renames
  276. ANSI.SYS to ANSI.OFF, thereby preventing it from loading when the
  277. computer is restarted.  Instead, an innocuous error message appears
  278. when the CONFIG.SYS file executes.  Put the line:
  279.  
  280. IF EXIST ANSI.OFF REN ANSI.OFF *.SYS
  281.  
  282. which tests for ANSI.OFF.  If ANSI.OFF is found, the line renames it
  283. ANSI.SYS, enabling it to load normally the next time the computer
  284. starts.
  285.      You can use a similar technique to temporarily eliminate any
  286. device driver from the CONFIG.SYS file.  This capability is useful if
  287. hardware compatibility is an issue or if you want to reclaim memory
  288. otherwise occupied by a device driver that you need only sporadically.
  289.  
  290. -----------------------------------------------------------------
  291.                   Circumventing a DOS 3.10 Bug
  292.              (PC World August 1986 The Help Screen)
  293.  
  294.      When assembling a master floppy disk for a new product, a bug in
  295. DOS 3.10 was discovered that apparently hasn't been reported.  The disk
  296. was formatted with the command FORMAT/B to reserve space at the
  297. beginning of the disk so users could add the DOS system files.  Next
  298. the relevant program files were copied to the disk.  This is identical
  299. to the procedure previously used to create master disks under DOS 2.10.
  300.      In attempting to make a bootable copy of the master disk, the DOS
  301. commands SYS and COPY were used to place the hidden system files
  302. (IBMBIO.COM and IBMDOS.COM) and COMMAND.COM onto the disk.  The disk
  303. was put in drive A: and the PC was rebooted.  The screen cleared, the
  304. cursor appeared, and drive A: started to whir.  Just when it seemed the
  305. drive should have stopped, the screen displayed roughly half a line of
  306. binary code and several lines of greater-than (>) characters.  DOS
  307. refused to load.
  308.      The procedure was repeated several times with various blanks disks
  309. and other copies of DOS 3.10 and on other PCs.  The results didn't
  310. change.  IBM confirmed that a problem did indeed exist with the /B
  311. option of the FORMAT command in DOS 3.10 and that no fix was available.
  312. DOS 3.10 does not allocate enough space for the IBMBIO.COM system
  313. module on the target disk.  As a result, the SYS command, which
  314. normally would make the disk bootable, does not work because the system
  315. module becomes fragmented after the transfer.
  316.      It's possible to use FORMAT/S to put the system files on the disk,
  317. add the product files, and finally use a utility to "zero out" the
  318. IBMBIO.COM and IBMDOS.COM files.  While DOS 3.10's SYS command will
  319. work on such a disk, DOS 2.xx's SYS command fails to produce a bootable
  320. disk.  It's also feasible to instruct buyers to use FORMAT/S on a blank
  321. disk and then COPY the product files.  The rub, however, is that the
  322. license agreement prohibits copying the product disk.  In any event,
  323. the DOS 3.10 manual is explicit about how disks should be prepared for
  324. publication.
  325.      The problem at hand is to produce a master product disk whose
  326. duplicates will work with the SYS commands of DOS 2.00 through 3.10.
  327. Format a disk using the FORMAT/B command.  Next, copy a dummy file
  328. that consists of, for example, the company's name.  Follow that by
  329. copying the product files to the disk.  Finally, erase the dummy file
  330. using the DEL command.  The disk space allocated by FORMAT/B plus the
  331. contiguous sectors freed by erasing the dummy file will accommodate
  332. the hidden system files transferred by the SYS command -- for IBM's
  333. DOS, that is.
  334.      Owners of PC and AT compatibles generally use a version of MS-DOS
  335. in which hidden system files are called MSDOS.SYS and IO.SYS.
  336. Accordingly, when users of the program invoke the SYS command of such
  337. a DOS version, they'll bump up against the file names IBMDOS.COM and
  338. IBMBIO.COM, which occupy the first two directory entries.  Because
  339. compatible versions of the SYS command expect the names MSDOS.SYS and
  340. IO.SYS, the error message "No room for system files on target disk"
  341. will be returned; this will occur instead of the system files
  342. overwriting the "unknown" files -- and possibly corrupting files on
  343. the disk.  To enable MS-DOS, as well as PC-DOS, users to place their
  344. operating systems on the product disk, use a utility program to change
  345. the first letters of the directory entries IBMDOS.COM and IBMBIO.COM
  346. to ASCII nulls (00).  From then on, all compatible versions of DOS
  347. will be able to "SYS" the disk.
  348.  
  349. -----------------------------------------------------------------
  350.                           Ctrl-Z Bypass
  351.       (PC Magazine Vol 5 No 15 Sept 16, 1986 User-to-User)
  352.  
  353.      The DOS TYPE command stops as soon as it sees the first CHR$(26)
  354. or Ctrl-Z end-of-file marker.  If you need to find particular text
  355. strings in binary files, TYPE doesn't always work.  However, COPYing
  356. file to the screen (CON) works the same way as TYPEing them, but with
  357. one advantage -- the COPY command has a /B option that will ignore
  358. each Ctrl-Z character.  So to put the contents of COMMAND.COM on-screen
  359. type:
  360.  
  361. COPY COMMAND.COM CON /B
  362.  
  363. While this will display the whole binary file, you'll probably see all
  364. sorts of strange-looking characters on-scree, especially if you have
  365. ANSI.SYS loaded.
  366.      Editor's Note:  Adding a /B at the end tells the COPY command to
  367. copy the actual length of the file as reported in the directory listing.
  368. While this trick will display the whole file, it will still trip over
  369. CHR$(7) beeps and other low-ASCII control characters.  A better way to
  370. hunt for text strings in binary files is to use a public domain utility
  371. like BROWSE.COM (PC Mag Vol 5 No 6) or Norton's TS.COM text search
  372. program.
  373.  
  374. -----------------------------------------------------------------
  375.                            Quick COPY
  376.              (PC World September 1986 Star-Dot-Star)
  377.  
  378.      The syntax for the COPY command given in the DOS manual implies
  379. that everything except the word COPY and the first filename is
  380. optional.  In fact, the COPY command, like the ERASE and DEL commands,
  381. assumes a source filename of *.* if a path alone is given.  Thus, the
  382. command COPY path is the equivalent of COPY path/*.*, just as the
  383. command ERASE path is identical to ERASE path/*.*.  The command COPY
  384. path path is equivalent to COPY path/*.* path/*.*.  This also works
  385. for concatenation, thus the command COPY path filename is the same as
  386. COPY path/*.* filename.
  387.      This tip may save only a few keystrokes, but if you frequently
  388. copy files between subdirectories, you'll save a lot of time.
  389.      Editor's Note:  This feature makes it possible to copy all of the
  390. files from a subdirectory by simply "copying" the subdirectory name.
  391. Notice that because this syntax also applies to the ERASE and DEL
  392. commands, you could inadvertently delete an entire group of files with
  393. a single command.  For this reason, DOS always asks "Are you sure
  394. (Y/N)?" before deleting all the files in a directory.  That's your
  395. signal to stop and reconsider.  Be sure you really want to delete
  396. every file before answering Y(es).
  397.  
  398. -----------------------------------------------------------------
  399.                        Pipeline Execution
  400.       (PC Magazine Vol 5 No 16 Sept 30, 1986 User-to-User)
  401.  
  402.      The DOS manual defines piping (which is invoked with the | symbol)
  403. as the "chaining of programs" but shows only how to redirect the output
  404. of DIR through SORT and FIND.  You can also use piping to execute
  405. several programs or commands in sequence.  For instance, if you had a
  406. GAMES subdirectory and a program called CHESS.COM, you could first
  407. change directories and then run CHESS by typing:
  408.  
  409. CD GAMES | CHESS
  410.  
  411. If you had another game called CHECKERS.COM in the same subdirectory,
  412. you could do the above and then run CHECKERS immediately after CHESS
  413. by typing:
  414.  
  415. CD GAMES | CHESS | CHECKERS
  416.  
  417.      Editor's Note:  While this doesn't work with all DOS commands, it
  418. does let you string certain operations together into one line.  For
  419. instance, if you wanted to create a subdirectory called TEST, copy all
  420. the files from your current subdirectory into it, log into it, and
  421. then, to see a directory listing, type:
  422.  
  423. md \test | copy *.* \test | cd \test | dir
  424.  
  425. -----------------------------------------------------------------
  426.                           Backup Dater
  427.       (PC Magazine Vol 5 No 16 Sept 30, 1986 User-to-User)
  428.  
  429.      When you're shuffling floppies in and out of a PC all day, you
  430. can lose track of which disks you've backed up and which you haven't.
  431. To get around this problem, create a tiny file on your disk called
  432. BACKD_UP.ON.  One way to do this is to get into BASIC and type
  433. (directly, without line numbers):
  434.  
  435. OPEN "O",#1,"BACKD_UP.ON":CLOSE
  436.  
  437. and then hit Enter.  Copy this file to your disks and correct the time
  438. and date of the directory listing with the command:
  439.  
  440. TYPE BACKD_UP.ON > BACKD_UP.ON
  441.  
  442. This assumes you set your system date and time correctly, of course.
  443. Then perform the actual backup process.  Later, by looking at the date
  444. in the directory listing for BACKD_UP.ON, you'll be able to tell at
  445. which point during the day you backed up the disk.
  446.      Editor's Note:  You don't need BASIC to creaet the BACKD_UP.ON
  447. file; you can do it handily by using COPY CON:BACKD_UP.ON.  And while
  448. the:
  449.  
  450. TYPE BACKD_UP.ON > BACKD_UP.ON
  451.  
  452. file update method is a clever way to change the date, since if you try
  453. running the command:
  454.  
  455. COPY BACKD_UP.ON BACKD_UP.ON
  456.  
  457. all you'll get is a "File cannot be copied onto itself" error message,
  458. an easier way is with the little-used directory updating command:
  459.  
  460. COPY BACKD_UP.ON+,,
  461.  
  462.      A completely different approach would be to use the DOS LABEL
  463. command as a place for a date.  To do so, patch COMMAND.COM so that
  464. instead of saying "Volume in drive B: is ..." it would say, "Backed
  465. up drive B: on ..."  Then use LABEL to add the date.  DIR would then
  466. report "Backed up drive B: on 9-10-86".  If you backed up additional
  467. files later, you could use LABEL to change the date.
  468.      To patch COMMAND.COM, use the DEBUG Search command to find the
  469. "Volume in drive" message by typing, at the DEBUG prompt:
  470.  
  471. S 100 6000 "Volume in drive"
  472.  
  473. In DOS 3.1, the address is 4A66.  Use the Enter command to change both
  474. the "Volume ..." message and the "is" that follows.  In DOS 3.1, you'd
  475. type:
  476.  
  477. E 4A66 "Backed up"
  478. E 4A82 "on"
  479.  
  480. Then Write the changes and Quit.
  481.  
  482. -----------------------------------------------------------------
  483.                        Disappearing Files
  484.       (PC Magazine Vol 5 No 16 Sept 30, 1986 User-to-User)
  485.  
  486.      By modifying the PERM.COM and UNPERM.COM programs (PC Magazine
  487. Vol 4 No 25 December 10, 1985 User-to-User) you can create HIDE.COM
  488. and UNHIDE.COM to hide and unhide any program.  A word of warning --
  489. even though you can mass-hide files by creating a HIDEM.BAT batch file
  490. with the single line:
  491.  
  492. FOR %%F IN (*.*) DO HIDE %%F
  493.  
  494. you won't be able to unhide all your files the same way, since global
  495. file characters work only on what is actually produce by a directory
  496. listing. Also, note that COMMAND.COM will execute a hidden AUTOEXEC.BAT
  497. file when booting up.  You can hide such system files as CONFIG.SYS,
  498. VDISK.SYS, and even COMMAND.COM itself, which can give your disks a
  499. bare root directory and a small measure of security.  If you do try
  500. the mass-hide, remember to keep UNHIDE.COM on a separate disk or
  501. subdirectory.
  502.      Type the following with an ASCII word processor and name it
  503. SCRIPT.  Make sure you leave a space before the RCX and before the
  504. W, and hit the Enter key after each line, especially the last one.
  505. Put DEBUG.COM on your disk, go to DOS and at the DOS prompt type:
  506.  
  507. DEBUG < SCRIPT
  508.  
  509. to create HIDE.COM and UNHIDE.COM.
  510.  
  511. N UNHIDE.COM
  512. A
  513. MOV BX,80
  514. INC BX
  515. CMP BYTE PTR [BX],20
  516. JZ 103
  517. MOV DX,BX
  518. INC BX
  519. CMP BYTE PTR [BX],D
  520. JZ 116
  521. CMP BYTE PTR [BX],0
  522. JNZ 10B
  523. MOV BYTE PTR [BX],0
  524. MOV CX,20
  525. MOV AL,1
  526. MOV AH,43
  527. INT 21
  528. INT 20
  529.  
  530. RCX
  531. 24
  532. W
  533. N HIDE.COM
  534. A 119
  535. MOV CX,27
  536.  
  537. W
  538. Q
  539.  
  540. -----------------------------------------------------------------
  541.                           DOS COPY Bug
  542.        (PC Magazine Vol 5 No 17 Oct 14, 1986 User-to-User)
  543.  
  544.      PC Mag Vol 5 No 13 PC Tutor discussed the dangers of inadvertently
  545. copying a file to itself when using DOS's ASSIGN command.  The problem
  546. is even more serious in DOS 3.1.  This article pointed out that if a
  547. file (here called MYFILE) resides in the root directory and you issue
  548. the command:
  549.  
  550. COPY MYFILE \MYFILE
  551.  
  552. DOS will attempt to copy the file onto itself rather than issuing a
  553. "File cannot be copied onto itself" message and stopping.  If MYFILE
  554. is larger than 64K, DOS will copy the first chunk of 64K and then
  555. print a "File allocation table error" message.
  556.      Try this in DOS 3.1 with a file larger than 64K, and DOS will
  557. print a normal "1 file(s) copied" message -- but will truncate the
  558. file to 64K without warning you.  This could be disastrous for those
  559. unaware of the problem.
  560.      Editor's Note:  While it's bad enough that DOS doesn't prevent
  561. you from copying any file onto itself, it's more insidious that under
  562. 3.1 it doesn't even print out an error message that would alert you to
  563. look at the directory listing and see what happened.  And this problem
  564. isn't just confined to the root directory.  If you're logged into a
  565. subdirectory called \DOS\UTILITY and you type COPY MYFILE MYFILE, DOS
  566. will indeed issue a warning and stop before it makes a copy.  But if
  567. you type COPY MYFILE \DOS\UTILITY\MYFILE you're in trouble.
  568.  
  569. -----------------------------------------------------------------
  570.                       Messages from CHKDSK
  571.          (PC Magazine Vol 5 No 17 Oct 14, 1986 PC Tutor)
  572.  
  573.      Among other things, CHKDSK checks for consistency between the
  574. disk's directory entries and its file allocation table (FAT).  The FAT
  575. is a map of the disk that shows how the disk's clusters are chained
  576. to link the data in each file.
  577.      When you get a "lost clusters" message from CHKDSK, there's
  578. usually not too much to worry about.  What it means is that an area
  579. on the disk has been allocated for a file but that the file was never
  580. properly closed.  The lost clusters are orphaned; the FAT says they've
  581. been allocated, but they don't belong to any file.  This sometimes
  582. happens if the program creating the file terminates abnormally or runs
  583. out of disk space and doesn't clean up afterward.
  584.      If you run CHKDSK with the /F parameter, it converts lost clusters
  585. to files in the root directory and gives them the extension .CHK.  If
  586. your normal files are missing something, that data could be in one of
  587. the .CHK files.  You can take a look at the .CHK files with the TYPE
  588. command, but unless they're in ASCII format and came from a word
  589. processing document, you probably won't be able to do much with them.
  590. If you're missing entire files from your directory, these .CHK files
  591. may correspond to the missing files.  This might be the result of
  592. having a damaged directory.  In such a case, the FAT still allocates
  593. chained clusters as if they belonged to a file, but the directory
  594. doesn't indicate where the chains begin.
  595.      Messages from CHKDSK indicating "cross-linked files" are cause
  596. for more concern.  Cross-linking means that the FAT's cluster chain
  597. for two or more files intersects at some point, so that some clusters
  598. seem to belong to multiple files.  In other words, your FAT or
  599. directory has probably been badly mangled.  Although cross-linking is
  600. relatively rate, it can be caused by gremlins (i.e., a power surge or
  601. line drop during a disk write operation).  In theory, gremlins strike
  602. randomly, but in practice they do their thing only to your most
  603. important files.
  604.      Watch out for this easy-to-make mistake: You can easily create a
  605. cross-linked FAT and a mangled directory by replacing a disk before
  606. typing an answer to an "Abort, Retry, Ignore" message.  Say you're in
  607. a program and try to save something to a floppy disk that has a write-
  608. protect tab.  DOS tries to write to the disk and then displays a
  609. "Write Protect Error" message followed by "Abort, Retry, Ignore."
  610. Instead of taking the write-protect tab off the disk (maybe you've
  611. just realized that the disk is the wrong one), you choose to put in
  612. another disk and press R for Retry. You can now kiss that data goodbye.
  613.      The problem is that DOS has already read FAT and directory
  614. information from the disk and modified that information before trying
  615. to write it back to the disk.  It displays the "Abort, Retry, Ignore"
  616. message only after it fails the write operation.  When you hit R to
  617. indicate Retry, DOS doesn't know that the disk has been replaced and
  618. thus writes the modified FAT and directory (or part of it) that it's
  619. read into memory from the original disk onto the new disk.
  620.  
  621. -----------------------------------------------------------------
  622.                           3.2 Speed Bug
  623.        (PC Magazine Vol 5 No 18 Oct 28, 1986 User-to-User)
  624.  
  625.      DOS 3.2 boasts an indidious (but easily correctable) bug --
  626. Internal Stack Error.  Simply hitting the Pause key on the new IBM
  627. keyboard rapidly 10 times will produce this error message and lock
  628. your system, forcing a power-down restart.
  629.      The DOS manual states that this error is caused by a "rapid
  630. succession of recursive hardware interrupts" and suggests adding the
  631. command STACKS=N,S to your CONFIG.SYS file.  N represents the number
  632. of stack frames, where the default is 9 and the range is 8 to 64.  S
  633. is the size in bytes of each frame, where the default size of each
  634. stack frame is 128 bytes and the range is 32 to 512.  Using this
  635. STACKS statement reduces available memory.
  636.      While most users don't pound the Pause key, a fast typist
  637. inputting data into a 123 spreadsheet can easily trigger the error.
  638. The problem can be pretty much eliminated by adding:
  639.  
  640. STACKS=32,256
  641.  
  642. to the CONFIG.SYS file, which lets you pound the Pause key about 25
  643. times before causing an error.
  644.  
  645. -----------------------------------------------------------------
  646.                       3.2 COMMAND.COM Patch
  647.        (PC Magazine Vol 5 No 18 Oct 28, 1986 User-to-User)
  648.  
  649.      DOS 2.0 through 3.1 COMMAND.COM can be patched to set the CLS
  650. colors.  (See PC Mag Vol 4 No 25 dec 10, 1985.)  The instructions for
  651. customizing DOS 3.2 so that CLS produces bright yellow text with a blue
  652. background follow.  Create a file called CLSPATCH containing these
  653. instructions, put CLSPATCH, DEBUG.COM, and COMMAND.COM on your disk,
  654. then type:
  655.  
  656. DEBUG < CLSPATCH
  657.  
  658.      Be sure to leave a blank line before the W, and hit the Enter key
  659. after each line, especially the last one.  Remember also that this is
  660. for DOS 3.2 only.
  661.  
  662. N COMMAND.COM
  663. L
  664. E 282E 1E
  665. M CS:281E 283A CS:2818
  666. A 2835
  667. MOV BL,01
  668. MOV AH,0B
  669.  
  670. W
  671. Q
  672.  
  673. -----------------------------------------------------------------
  674.                    PC Restart Sans Diagnostics
  675.              (PC World October 1986 The Help Screen)
  676.  
  677.      A short program that restarts the PC minus diagnostics is easy
  678. to write in assembly language.  Place a blank, formatted disk in drive
  679. A: and a copy of DEBUG.COM in drive B:.  (You can also use DEBUG from
  680. a hard disk.)  At the A> prompt, type B:DEBUG <Enter> (or C:DEBUG
  681. <Enter> for a hard disk).  DEBUG's hyphen prompt will appear.  Type
  682. A <Enter>.  Type the following, pressing <Enter> at the end of each
  683. line:
  684.  
  685. MOV DX,40
  686. MOV DS,DX
  687. MOV BX,72
  688. MOV WORD PTR[BX],1234
  689. JMP FFF:0
  690.  
  691. Press <Enter> again and the hyphen prompt reappears.  Type R CX
  692. <Enter>.  Zeros will appear, followed by a colon prompt and the
  693. cursor.  Type 11 <Enter> to indicate the file's size, then N
  694. WARMBOOT.COM <Enter> to name the file, and W <Enter> Q <Enter> to
  695. write the file to disk and quit DEBUG.  Test the newly created
  696. program by typing WARMBOOT <Enter>.
  697.      This program ensures that the PC's "reset flag" is set to the
  698. value 1234 hexadecimal.  Any other value results in a cold boot.  To
  699. create a reboot program that does include the power-on diagnostics,
  700. follow the instructions for WARMBOOT.COM but substitute a different
  701. value for 1234 and name the file COLDBOOT.COM.
  702.  
  703. -----------------------------------------------------------------
  704.                       DEBUGging with ProKEy
  705.         (PC Magazine Vol 5 No 20 Nov 25, 1986 Power User)
  706.  
  707.      DEBUG.COM does not allow you to scroll back and look at some code
  708. that was displayed on the screen a few seconds (or 10 minutes) earlier.
  709. You could use Ctrl-PrtSc to echo everything to the printer, but that
  710. is tediously slow.  What you want is to capture an entire DEBUG session
  711. to a disk file.  That way one can later scroll through and study the
  712. output or print selected portions to study or show to others.
  713.      DOS I/O redirection can capture to disk, of course, but working
  714. inside DEBUG with a blank screen (while redirection is occurring) is
  715. impractical.  However, when redirection is teamed up with ProKey, it's
  716. a different story.
  717.      The trick is to run DEBUG twice.  The first session -- while
  718. ProKey records keystrokes -- looks like this:
  719.  
  720. A>DEBUG XYZ.COM <Ret>
  721. <alt=><F1>
  722. DEBUG SESSION HERE
  723. <alt->
  724.  
  725. The <alt=><F1> keystrokes being recording the macro as F1.  The <alt->
  726. stops recording the macro after exiting from DEBUG.
  727.      The second DEBUG session is:
  728.  
  729. A>DEBUG XYZ.COM > DUMP.FIL <Ret>
  730. <F1>
  731.  
  732. The first line here routes the output to DUMP.FIL.  The second starts
  733. the macro playback.  All video output is redirected to disk, with the
  734. ProKey macro providing the needed keystrokes.
  735.      If you prefer, separate macros can be used for selected parts of
  736. a session.  Finally, this technique is not limited to DEBUG.  It can
  737. be used to capture the screen activity of any program that uses
  738. standard DOS video calls.
  739.      Editor's Note:  Keep in mind also that the macro itself documents
  740. your work.  If you run into a discrepancy when typing a complicated
  741. patch, you can compare the macro to the printed instructions to see
  742. where you went wrong.  And if you're creating a patch, you can use the
  743. macro for giving keystroke-by-keystroke instructions to others.  This
  744. use of the macro as documentation has even wider applicability than
  745. the redirection technique.  It will work with any program that ProKey
  746. works with, not just those programs that use standard DOS video calls.
  747.  
  748. -----------------------------------------------------------------
  749.                       Going Back to DOS 2.x
  750.          (PC Magazine Vol 5 No 20 Nov 25, 1986 PC Tutor)
  751.  
  752.      The enhancements to DOS 3.x include an alternative organization
  753. of the file allocation table (FAT) for hard disks greater than 10
  754. megabytes.  Briefly stated, DOS 3.x allows cluster sizes on a hard
  755. disk to be represented by 16-bit values instead of 12-bit values.
  756. This results in more efficient use of hard disk space.  However, DOS
  757. 2.x can work only with the old 12-bit FAT.
  758.      It's a good thing that DOS 2.x doesn't recognize a 20-megabyte
  759. (or greater) hard disk formatted under DOS 3.x.  If the operating
  760. system were to assume that the FAT contained 12-bit values, it could
  761. easily scramble up the FAT beyond recognition.  Since the FAT is the
  762. most critical part of a disk, this would be a serious problem.
  763.      How does DOS 2.x know whether to leave the disk alone?  The
  764. answer is another table -- the partition table.  A hard disk can be
  765. divided into one to four partitions, each of which may use a different
  766. operating system.  (Most XT and AT users allocate the entire hard disk
  767. for a single DOS partition, of course.)  A table with the partition
  768. information is stored on the first sector of the disk.  Each partition
  769. has a "system indicator," a 1-byte value that designates the operating
  770. system for the partition.  DOS 2.x uses 01 to indicate a DOS partition.
  771. DOS 3.x uses a value of 01 for a DOS partition with a 12-bit FAT, but
  772. 04 for a DOS partition with a 16-bit FAT.  So, when DOS 2.x looks at a
  773. hard disk partition table and sees a 04 system indicator, it thinks the
  774. partition is non-DOS, even though it really is a DOS partition.
  775.      You'll experience this DOS 2.x incompatibility only with hard
  776. disks greater than 10 megabytes formatted under DOS 3.x.  A normal
  777. PC-XT 10-megabyte disk can be used by either DOS 2.x or DOS 3.x,
  778. regardless of the formatting.
  779.  
  780. -----------------------------------------------------------------
  781.                Exiting Assembly Language Programs
  782.          (PC Magazine Vol 5 No 21, Dec 9, 1986 PC Tutor)
  783.  
  784.      DOS provides several different ways to exit an assembly language
  785. program, and they are all pretty much the same.
  786.      Under all versions of DOS, the most common method is the INT 20h
  787. command.  But you can also use:
  788.  
  789. MOV AH,0
  790. INT 21h
  791.  
  792.      The first 2 bytes of the Program Segment Prefix (PSP) that DOS
  793. builds at the beginning of all programs loaded into memory contain the
  794. machine code for an INT 20h (the bytes CD 20h).  For a .COM program,
  795. DOS pushes a word of zeros on the stack before it turns control over
  796. to the program.  Thus (assuming that the stack pointer is the same as
  797. it was on entry to the program) a .COM program can terminate with a
  798. simple RET instruction.  This branches to the beginning of the PSP and
  799. executes the INT 20h instruction.
  800.      Using this fact, you can create the shortest possible .COM program
  801. (1 byte long) thus:
  802.  
  803. CSEG    SEGMENT
  804.     ASSUME CS:CSEG
  805.     ORG 0100h
  806. ENTRY:    RET
  807. CSEG    ENDS
  808.     END ENTRY
  809.  
  810. You can also exit a .COM program by branching to the beginning of the
  811. PSP directly.  If the beginning of a program looks like this:
  812.  
  813. CSEG    SEGMENT
  814.     ASSUME CS:CSEG
  815. ZERO:
  816.     ORG 0100h
  817.  
  818. you can exit it with either
  819.  
  820. JMP ZERO
  821.  
  822. or
  823.  
  824. CALL ZERO
  825.  
  826. Prior to DOS 2.0, interrupt 20h presented some problems for .EXE
  827. programs.  Interrupt 20h requires teh value of the CS (Code Segment)
  828. register to point to the beginning of the PSP.  In the general case,
  829. this is not true for .EXE programs.  On entry, however, the value of
  830. the DS (Data Segment) register points to the PSP.  So, to use interrupt
  831. 20h, .EXE programs have to execute code that looks something like:
  832.  
  833. PUSH DS
  834. MOV AX,0
  835. PUSH AX
  836.  
  837. This code puts the far address (segment plus offset) of the beginning
  838. of the PSP on the stack.  The .EXE program can then exit with a:
  839.  
  840. RET
  841.  
  842. within a far procedure.  This effectively branches to the INT 20h
  843. instruction at the beginning of the PSP.
  844.      Beginning with DOS 2.0, interrupt 21h function call 4Ch was
  845. added.  This function call has two advantages over interrupt 20h.
  846. First, it does not require that the CS register point to the PSP.
  847. Second, a program can pass back a return call (in register AL) to DOS.
  848. This return code can be used in a batch file IF ERRORLEVEL statement.
  849. Or, if the program is executed through function call 4Bh as a child
  850. process of another program, the parent program can retrieve the return
  851. code through function call 4Dh.
  852.      Aside from these advantages over interrupt 20h, however, the two
  853. termination methods are functionally about the same.  In DOS 3.2, DOS
  854. turns an interrupt 20h into an interrupt 21h function call 0.  Function
  855. calls 0 and 4Ch both execute a few lines of code on their own but then
  856. share the bulk of the DOS code involved in terminating programs.
  857.      The story is similar for interrupt 27h.  By setting register DX
  858. to the end of the program and executing an INT 27h, a program can
  859. terminate but remain resident.  This works for all DOS versions.
  860. Interrupt 27h is a problem with .EXE programs because CS must again
  861. point to the beginning of the PSP.
  862.      Beginning with DOS 2.0, interrupt 21h function call 31h can also
  863. be used to terminate and remain resident.  Here register DX is the size
  864. of the program in paragraphs.  (A paragraph is 16 bytes.)  By using a
  865. paragraph size rather than a byte size, function call 31h allows a
  866. program larger than 64K to remain resident in memory.  Like function
  867. call 4Ch, you can also pass back a return code with function call 31h.
  868. But again, interrupt 27h and function call 31h share a lot of DOS code.
  869.      Function calls 4Ch and 31h are now the "preferred" methods for
  870. exiting assembly language programs, but only because they are more
  871. flexible than interrupts 20h and 27h.  The only problem with these
  872. methods is that these two function calls don't work under DOS 1.1.
  873. Although DOS 1.1 is nearly extinct, if the rest of a program can run
  874. under DOS 1,1, it would be silly to terminate with a function call not
  875. supported by DOS 1.1.
  876.      Some people believe that interrupts 20h and 27h will be eliminated
  877. in future versions of DOS.  For instance, the Microsoft Press MS-DOS
  878. Technical Reference Encyclopedia (which was recalled about a month
  879. after it was released because of gross errors) describes interrupts
  880. 20h and 27h as "obsolete."  It also says that programs that remain
  881. resident in memory should use function call 31h to "ensure
  882. compatibility with future versions of DOS."
  883.      If a future DOS version must eliminate interrupts 20h and 27h,
  884. this will be the least troublesome of the changes you'll have to make
  885. to assembly language programs.  This is under the assumption that the
  886. future 80286 protected-mode version of DOS (which is really the only
  887. future DOS version that matters) will require you to make changes in
  888. all assembly language programs, and that programs written in high-level
  889. languages may only have to be recompiled and relinked.
  890.  
  891. -----------------------------------------------------------------
  892.                      DOS 3.2 Incompatibility
  893.         (PC Magazine Vol 5 No 22 Dec 23, 1986 PC Advisor)
  894.  
  895.      The only existing DOS incompatiblity we know of is between IBM
  896. DOS 3.2 and some earlier DOSs not licensed by IBM.
  897.      The problem results from DOS 3.2's attempt to read the name of
  898. the manufacturer and the format of a disk from the BIOS Parameter
  899. Block, information which is contained in the boot sector of the disk
  900. (sector 0, track 0).  Both IBM and Microsoft have specified that the
  901. name of the manufacturer appear within the first 8 bytes in this disk
  902. sector.  Most DOSs include the letters I B M along with the version of
  903. DOS when formatting information is written to disk in this sector.  In
  904. earlier versions, DOS ignored this information; IBM's DOS 3.2 insists
  905. on finding it.  When it doesn't DOS will refust to read the disk.
  906.      Because IBM sells DOS under license from Microsoft, IBM can decide
  907. not to support non-IBM DOSs.  There are no products now available to
  908. solve this.
  909.      There are two solutions.  You can boot an earlier version of DOS
  910. and then copy all your files onto disks that were formatted under 3.2.
  911.      Or, if you feel comfortable using DEBUG, you can write the
  912. information DOS 3.2 wants to find onto the disks.  Load DEBUG from a
  913. DOS prior to 3.2:
  914.  
  915. DEBUG
  916.  
  917. Put a nonbootable disk that DOS 3.2 can read into drive A:.  Type:
  918.  
  919. L 100 00 1
  920.  
  921. Now replace the disk with the problem disk.  Type:
  922.  
  923. W 100 0 0 1
  924.  
  925. Quit DEBUG:
  926.  
  927. Q
  928.  
  929. -----------------------------------------------------------------
  930.                           Security Leak
  931.              (PC World December 1986 Star-Dot-Star)
  932.  
  933.      When you use an encryption program to secure a data file, it's
  934. important to make sure that you encrypt or destroy all copies of the
  935. file as well.  Many spreadsheet programs, word processors, and data
  936. base managers automatically make backup files, usually with the .BAK
  937. extension.  Simply deleting those file does not make your data secure.
  938. Anyone can use a file recovery program (such as PC Tools or The Norton
  939. Utilities) to gain access to the contents of "deleted" files.
  940.      A more insidious danger: Many programs create temporary files
  941. and only later delete them.  (You may notice these files if a program
  942. is halted by an error.)  Because you don't see these files listed in
  943. the directory, you might not think to destroy them.
  944.      The best solution is to copy the encrypted file onto another disk,
  945. then format the original disk to eliminate any sensitive data.
  946.      Editor's Note:  If you use a hard disk, you'll find destroying
  947. such latent data virtually impossible.  At least one encryption
  948. program, Datasafe from Trigram Systems, sports a command that erases
  949. data from unused disk sectors.  Another solution is to use a RAM disk
  950. to hold sensitive data files during program execution, then encrypt
  951. the result and copy it back to a floppy or hard disk.
  952.  
  953. -----------------------------------------------------------------
  954.                       2K Hard Disk Clusters
  955.             (PC World December 1986 The Help Screen)
  956.  
  957.      Several readers have asked for step-by-step instructions after
  958. failing to implement "Hard Disk Elbowroom" (PC World April 1986 Star-
  959. Dot-Star).  That item showed readers how to reduce a 10MB hard disk's
  960. cluster size from 4K to 2K.  But it contained the phrase "place the
  961. DOS Supplemental Programs disk into the floppy drive and enter the
  962. commands listed in DISKSIZE," which led many readers to believe that
  963. DISKSIZE was a file on the Supplemental Programs disk.  DISKSIZE is
  964. actually the name of the figure on the following page of that issue.
  965. It lists the DEBUG commands used to patch the boot (first) sector of
  966. the hard disk.  Other readers figured that out but where thrown a
  967. curve because of the instruction "Run the FDISK program to create a
  968. DOS partition ..."  That sentence should have read "Run the FDISK
  969. program to delete and then recreate a DOS partition ..."
  970.      The following procedure is for those with 10MB hard disks, and
  971. it requires DOS 3.10 -- not 3.00 or 3.20.  If your hard disk is 20MB
  972. or larger, simply formatting it with DOS 3.00 or a later version will
  973. give your hard disk 2K clusters; therefore, this procedure does not
  974. pertain to your system.  (Note, too, that if your hard disk is smaller
  975. than 10MB, this procedure cannot be followed.)
  976.      Assuming you have a 10MB hard disk, your first step is to check
  977. the current cluster size.  Log onto the hard disk's DOS directory or
  978. insert a copy of the DOS disk in drive A:.  Make the drive containing
  979. the DOS files the default drive, and at the DOS prompt type:
  980.  
  981. CHKDSK C:
  982.  
  983. and press Enter.  (If your PC's hard disk is not drive C:, substitute
  984. the appropriate drive designator wherever C: is specified.)  Write down
  985. the number preceding "bytes available on disk."  Next, make the hard
  986. disk the default drive, type
  987.  
  988. COPY CON:DUMMY
  989.  
  990. and press Enter.  Then type:
  991.  
  992. DUMMY
  993.  
  994. followed by Ctrl-Z (or press the F6 key), and press Enter.  Run
  995. CHKDSK C: again, and subtract the number of "bytes available on disk"
  996. given by the second CHKDSK from the value given by the first CHKDSK.
  997. This value is the current cluster size of your PC's hard disk; if it
  998. is 2048, your hard disk already has 2K clusters.  In any case, issue
  999. the command:
  1000.  
  1001. ERASE C:DUMMY
  1002.  
  1003. and press Enter to remove the dummy file.
  1004.      If the cluster size is larger than 2048, back up the hard disk
  1005. file by file.  (If you use certain copy-protected programs, you may
  1006. have to uninstall them before backing up the hard disk.)  If you are
  1007. backing up to floppies, you'll need about 28 blank 360K floppies.  Be
  1008. sure to format and number the disks before you begin the backup
  1009. procedure.
  1010.      Once the backup is complete, place an unmodified copy of DOS 3.10
  1011. in drive A: and restart the PC.  Set the date and time.  Type:
  1012.  
  1013. FDISK
  1014.  
  1015. and press Enter.  Type:
  1016.  
  1017. 3
  1018.  
  1019. and press Enter to delete the existing DOS partition.  Type:
  1020.  
  1021. Y
  1022.  
  1023. and press Enter to verify your intention.  Then press:
  1024.  
  1025. ESC
  1026.  
  1027. type:
  1028.  
  1029. 1
  1030.  
  1031. and press Enter to create a DOS partition.  If you are going to use
  1032. the entire disk for DOS (in other words, if you're not planning to
  1033. install an additional operating system), simply press Enter two more
  1034. times.  Otherwise, type:
  1035.  
  1036. N
  1037.  
  1038. and press Enter, enter the desired size and starting cylinder, and
  1039. press:
  1040.  
  1041. ESC
  1042.  
  1043. three times.  Reset the date and time, type:
  1044.  
  1045. FORMAT C:
  1046.  
  1047. and press Enter.  (Do not use the /V or /S options.)  Type:
  1048.  
  1049. Y
  1050.  
  1051. and press Enter.
  1052.      Next, replace the DOS disk with one containing a copy of DEBUG.COM
  1053. from the DOS Supplemental Programs disk.  Following the procedure below
  1054. by typing the missing characters from those displayed on the screen,
  1055. and press Enter at the end of each line.  Also, substitute the
  1056. appropriate hard disk number for n -- 1 if drive B:, 2 if drive C:, 3
  1057. if drive D:, and so on.  Don't omit any spaces, and note that the 0 is
  1058. a zero, and not the letter O.
  1059.  
  1060. A>DEBUG
  1061. -l 0 n 0 1
  1062. -E D
  1063. xxxx:000D 08.4
  1064. -E 16
  1065. xxxx:0016 08.15
  1066. -W 0 n 0 1
  1067. -Q
  1068.  
  1069.      Now place the DOS 3.10 disk in drive A: and reboot the PC.
  1070. Although the DOS prompt is present and DOS 3.10 is already loaded,
  1071. you must restart the system.  Set the date and time, type:
  1072.  
  1073. FORMAT C:/S/V
  1074.  
  1075. and press Enter.  Type:
  1076.  
  1077. Y
  1078.  
  1079. and press Enter to proceed with formatting the hard disk.  When
  1080. prompted, enter a volume label.
  1081.      If you would like to verify that the disk now has 2K clusters,
  1082. follow the procedure discussed above to create the DUMMY file.  Do
  1083. not reload the files IBMBIO.COM and IBMDOS.COM (called IO.SYS and
  1084. MSDOS.SYS by some compatible versions of DOS); doing so renders what
  1085. you've done so far useless, forcing you to reformat the hard disk and
  1086. start over.  If your backup contains a version of COMMAND.COM other
  1087. than from DOS 3.10, do not reload it either.  If you are using DOS's
  1088. RESTORE command, you can use the /P option, which asks if you want
  1089. system files restored to the disk.  Finally, remove any disk in
  1090. drive A: and restart the PC from the hard disk.  That's it.
  1091.  
  1092.